﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

[DataContract]
public partial class Albums
{
    [DataMember(Name = "results")]
    public List<Album> Items { get; set;}
    [DataMember]
    public object meta { get; set; }
}


public class AlbumPhoto
{
    public string photo_link { get; set; }
    public string highres_link { get; set; }
    public string thumb_link { get; set; }
    public long photo_id { get; set; }
}

public partial class Album
{
    public string title { get; set; }
    public long created { get; set; }
    public long updated { get; set; }
    public long group_id { get; set; }
    public long photo_album_id { get; set; }
    public string event_id { get; set; }
    public int photo_count { get; set; }
    public AlbumPhoto album_photo { get; set; }

    private DateTime internalTime
    {
        get
        {
            if (created == null) return new DateTime();
            DateTime dt70 = new DateTime(1970, 1, 1, 0, 0, 0, 0);
            long ticks1970 = dt70.Ticks;

            System.DateTime t = new DateTime((created * TimeSpan.TicksPerMillisecond) + ticks1970);
            return t.ToLocalTime();
        }
    }

    public String DateTime
    {
        get
        {
            // return created;
            return internalTime == System.DateTime.MinValue ? "TBD" : internalTime.ToString("f");
        }
    }

}
